//token常量名

const TokenKey = 'accessToken';
const RefreshTokenKey = 'refreshToken';
//设置token，refresh
export function setToken (token, refreshToken) {
    localStorage.setItem(TokenKey, token);
    localStorage.setItem(RefreshTokenKey, refreshToken);
}
//保存token
export function getToken(){
   return localStorage.getItem(TokenKey);
}
//保存refresh
export function getRefresh(){
    return localStorage.getItem(RefreshTokenKey);
}
//清除token和refresh
export function Remove(){
    localStorage.removeItem(TokenKey);
    localStorage.removeItem(RefreshTokenKey);
}
//是否登录
export function isAuth(){
    let token=getToken();
    if(token){
        return true;
    }
    return false;
}